<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>     
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>   

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<c:choose>
	 <c:when test="${os eq 'wechat'|| os eq 'web'}"><script src="${host_url}/js/app/commonForWe.js"></script></c:when>
	 <c:otherwise><script src="${host_url}/js/app/common.js"></script></c:otherwise>
</c:choose>
<link rel="stylesheet"  href="${host_url}/css/app/profit.css">
<link rel="stylesheet"  href="${host_url}/css/app/dropload.css">
<link rel="stylesheet" href="${host_url}/css/app/common.css">
<script src="${host_url}/js/app/jquery.min.js"></script>
<script src="${host_url}/js/app/dropload.min.js"></script>
<script type="text/javascript">

	var withdrawDepositItem="";
	var m_os="${os}";
	if(m_os=="wechat" || m_os=='web'){
		withdrawDepositItem="withdrawDepositItem.do";
	}else{
		withdrawDepositItem="withdrawDepositItem";
	}

  document.getElementsByTagName('html')[0].style.fontSize = document.documentElement.clientWidth/50 + 'px';
  
  function GetToken(id){
	  var withdrawdepositlogone_url = $("#withdrawdepositlogone_url").val();
      window.webkit.messageHandlers.ios_open_page.postMessage('WKViewController:::url->'+withdrawdepositlogone_url+'?withdrawDeposit_id='+id+':::webTitle->交易明细:::isRefresh->YES');
  }   

  
  $(function(){
		/*  页数 */
		var page_index_all = 2;/*  全部 */
		
	    /* dropload 加载分页 */
	    loadPagination("listAll",page_index_all,"logAll");
	});	

	function loadPagination(div_id, page_index, ul_id){
		$('#'+div_id).dropload({
	        scrollArea : window,
	        loadDownFn : function(me){
	            $.ajax({
	                type: 'get',
	                url: withdrawDepositItem+'?page_index='+page_index,
	                dataType: 'text',
	                beforeSend: function(request) {
	    				request.setRequestHeader("AUTHORIZATION","${token}");
	    				request.setRequestHeader("SECRET","${memberId}");
	    				request.setRequestHeader("OS","${os}");
	    			 }, 
	                contentType:"application/x-www-form-urlencoded; charset=UTF-8",
	                success: function(msg){
	                    if($.trim(msg)){
	                		page_index++;
	                    	$("#"+ul_id).append(msg);
	                    	me.resetload();
	                   	/*  如果没有数据 */
	                    } else{
	                        	/*  锁定 */
	                        me.lock();
	                        	/*  无数据 */
	                        me.noData();
	                        if($("#"+ul_id+" > li")){
		                    	   $("#"+div_id+" .dropload-load").html("");
		                    }else{
		                    	 $("#"+div_id+" .dropload-load").html("");
		                    }
	                    } 
	                },
		                error: function(xhr, type){
	                    	/*  即使加载出错，也得重置 */
	                    me.resetload();
	                } 
	            });
	        }
	    });
	}  
</script>
<title>list</title>
</head>
<body>
<input type="hidden"  id="withdrawdepositlogone_url" value="${withdrawdepositlogone_url }">
	<c:if test="${withdrawDeposit_Log.size()>0}">
	<div class="content" id="listAll">
	    <ul id="logAll">
		     <c:forEach items="${withdrawDeposit_Log}" var="c">
			         <c:if test="${'ios'==os}">
					     <li class="clearfix" onclick="GetToken(${c.withdrawDeposit_id})">
			         </c:if>
			         <c:if test="${'wechat'==os ||'web'==os}">
					     <li class="clearfix" onclick="GetDetail('${c.withdrawDeposit_id}')">
			         </c:if>
			    	 <c:if test="${'android'==os}">
			            <li class="clearfix" onclick="android.startUrl('交易明细','${withdrawdepositlogone_url}','withdrawDeposit_id->${c.withdrawDeposit_id}')">
			         </c:if>
			            <p class="leftArea">
			                <span style="font-size:14px;">             	 
			                	<c:if test="${c.state == 2 and c.log_cash_draw_state == 0}">余额提现（提现中）</c:if>  
			                	<c:if test="${c.state == 2 and c.log_cash_draw_state ==1}">余额提现</c:if> 
			                	<c:if test="${c.state == 2 and c.log_cash_draw_state ==2}">余额提现（提现失败）</c:if>   
			                </span><br/>
			                  <fmt:parseDate value=" ${c.create_time}" var="date" pattern="yyyy-MM-dd HH:mm:ss"/>  
			  				  <span class="gray" style="font-size:12px;"><fmt:formatDate value="${date}" pattern="yyyy-MM-dd HH:mm" /></span>
			            </p>
			            <p class="rightArea" style="font-size:14px;">${c.free_cash}</p>
			        </li>
		      </c:forEach>  
	    </ul>
	</div>
	</c:if> 
<c:if test="${withdrawDeposit_Log.size()==0}">
	<div class="zanwu">
		  <span><img src="${host_url}/img/app/zanwu.png"></span>
		  <p>暂无记录</p>
	</div>
</c:if> 
</body>
</html>

